﻿using System;
using System.Diagnostics;

namespace VmpRsaDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                var sw = new Stopwatch();
                sw.Start();
                string data = @"PHZtcC1sbS1wcm9kdWN0IGFsZ29yaXRobT0iUlNBIiBiaXRzPSIyMDQ4IiBleHA9ImROS0U2Y1ZG
                    WThkbzhKM1FNdERXeXg5eEU4NVhheEZRcXJPWHh2c0lHZXg4ZUFjdEVIalc2bzhEZmZCV0Z1RmxX
                    aWF6SnpUVlVFcVRKY0hLMnowaUtneUFNU3NNR25mOU5pYWNXUnFqdFF4ZmRiT01yVjhZc3dvS1oy
                    MTB5SVIzejR0cmZRVnhFR1BuWVZNdVlqWm5wTkpqNGc1S3hCdEJ5MDJsRDFLWXZBSzhOMTkxclAr
                    SWZuZHZFK0h0ZUxUT3JmVDV0WU9oTll6K1FtVGc3SHp2aHd0RDJ2ZUZXUnFRUlN3TGxxOWFNVW5q
                    MWV0N2hnaHJwZjNnZm9mM2FGOVNCa3gxRFk0OWd4MU1pcE9DYXcrYlFnSUxldHVDd1REUDFIZGlY
                    MkNIWktpRDd2bVdEQU5aTFBMbmhTdG5rMmUzeCtLVWN6SXZ6ejVvUnM0UlVxeStJUT09IiBtb2Q9
                    IkFMT1dkL3F1UjlNY3dYUU9DRVE0dm1jSWV1ZEJwQU9DNFhpbXpuQnRucHRLS2FFQUxMamp2OWNi
                    T2ZiOTNNaGVJa1hyenJNS21JRzBhRDhuSjg1NHdTajRJcEw0aVozdHlwSEYrOTN2S3MwSDlCbEpY
                    ckRDSFRoMldsSjdjQVBOZHdSTGZNN2NsVys0ZCsvVGc1eDk2K1FaL2t3YlhQaE5TRDMzakJ5VXh2
                    Z21JNEV0NnAyM3F6NGRZdlVoZjYvOEFzUk5rNSszdE9FdytmeGhHK3dueEtwZXFPd3pVdkRHV2tz
                    MkZDL093SFAyRms5NUhNWmp2MkxtcEhNVXdYa3kvZ0FIbzgvK0FuVUt5R1JyRWhKZ3hTcXVtSTFk
                    Rk56ZTdkMEtMSFVRUnBMK0F3LzF4bC9HcWl5TVVhSFYyVnBEUXNJK3hQTFhPWHpJcVZXSzBDeTFj
                    S0U9IiBwcm9kdWN0PSJJeGtFYjRRYW5sdz0iLz4="; // put the exported data here
                var g = new Generator(data)
                {
                    UserName = "John Doe",
                    EMail = "john@doe.com",
                    ExpirationDate = DateTime.Now.AddMonths(1),
                    MaxBuildDate = DateTime.Now.AddYears(1),
                    RunningTimeLimit = 15,
                    HardwareID = "AQIDBAgHBgU=",
                    UserData = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
                };
                var serial = string.Empty;
                for (int i = 0; i < 100; i++)
                {
                    serial = g.Generate();
                    Console.WriteLine("Serial number: \n{0}", serial);
                }

                sw.Stop();
                Console.WriteLine("time: {0}", sw.Elapsed);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: {0}", ex);
            }

            Console.ReadKey();
        }
    }
}
